#!/usr/bin/env python
# coding: utf-8

import smtplib
import string

HOST = "smtp.163.com"
SUBJECT = "haha"
FROM = "ldczz2008@163.com"
TO = ["cc@niubi.com"]
MESSAGE = u"python test script"
BODY = string.join((
    "From: %s" % FROM,
    "To: %s" % TO,
    "Subject: %s" % SUBJECT,
    "",
    MESSAGE
    ), "\r\n")

server = smtplib.SMTP()
server.connect(HOST, 25)
server.login("ldczz2008@163.com", "xxxxxxxxxxxxx")
server.sendmail(FROM, TO, BODY)
server.quit()

